package OpenId

import (
	"OnlineRetailers/controllers/admin/session"
	"OnlineRetailers/models"
)

func NewOpenId(openId string) (err error) {
	conn := models.Pool.Get()

	defer func() {
		err = conn.Close()
		if err != nil {

		}
	}()

	_, err = conn.Do("SET", openId, openId)
	if err != nil {
		return
	}
	err = session.UpdateSession(openId)

	return
}
